ipv6: Consider sk_bound_dev_if when binding a socket to an address
authorDavid Ahern <dsahern@gmail.com>
Thu, 3 Jan 2019 02:57:09 +0000 (18:57 -0800)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 17 Jan 2019 18:56:17 +0000 (18:56 +0000)
commit1b3d11ded50b5e912f833666ad7ae990a922c26e
treef104bd202e55fd2510fc10153e6fc697ec0e2a38
parent311247324a0080bd4273a5b8a283546529ccf9e8
ipv6: Consider sk_bound_dev_if when binding a socket to an address

IPv6 does not consider if the socket is bound to a device when binding
to an address. The result is that a socket can be bound to eth0 and then
bound to the address of eth1. If the device is a VRF, the result is that
a socket can only be bound to an address in the default VRF.

Resolve by considering the device if sk_bound_dev_if is set.

This problem exists from the beginning of git history.

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name ipv6-Consider-sk_bound_dev_if-when-binding-a-socket-.patch
net/ipv6/af_inet6.c